<?php

namespace app\index\model;

use think\Model;

class ShopCart extends Model
{
    protected  $table='shop_cart';

    public  function orderNum(){
        return $this->belongsTo('OrderNum',"order_id",'id');
    }
    public  function goods(){
        return $this->belongsTo('Goods','goods_id','id');
    }

    public  function  address(){
//        return $this->belongsToMany('Address','OrderNum','address_id','id');
    return $this->hasManyThrough('Address','OrderNum','address_id','id');
    }

}
